package com.ruoyi.system.mapper;

import java.util.List;

import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.system.domain.LeaveApplications;
import org.apache.ibatis.annotations.Param;
/**
 * 请假申请Mapper接口
 *
 * @author ruoyi
 * @date 2025-03-30
 */
public interface LeaveApplicationsMapper
{
    /**
     * 查询请假申请
     *
     * @param id 请假申请主键
     * @return 请假申请
     */
    public LeaveApplications selectLeaveApplicationsById(Long id);

    /**
     * 查询请假申请列表
     *
     * @param leaveApplications 请假申请
     * @return 请假申请集合
     */
    public List<LeaveApplications> selectLeaveApplicationsList(LeaveApplications leaveApplications);

    /**
     * 新增请假申请
     *
     * @param leaveApplications 请假申请
     * @return 结果
     */
    public int insertLeaveApplications(LeaveApplications leaveApplications);

    /**
     * 修改请假申请
     *
     * @param leaveApplications 请假申请
     * @return 结果
     */
    public int updateLeaveApplications(LeaveApplications leaveApplications);

    /**
     * 删除请假申请
     *
     * @param id 请假申请主键
     * @return 结果
     */
    public int deleteLeaveApplicationsById(Long id);

    /**
     * 批量删除请假申请
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteLeaveApplicationsByIds(Long[] ids);




    List<SysUser> selectDeptManagersByUserId(@Param("userId") Long userId, @Param("roleId") Long roleId);



    List<LeaveApplications> selectLeaveListByRole(
            @Param("leaveApplications") LeaveApplications leaveApplications,
            @Param("currentUserId") Long currentUserId
    );

    // 请假天数
    int selectMonthlyLeaveDays(@Param("userId") Long userId);
}
